import request from "@/utils/request";

/**
 * 查询用户角色
 * @param data
 * @returns {*}
 */
export function getRoleList(params) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemRole/index",
    method: "get",
    params,
  });
}


/**
 * 添加用户角色
 * @param data
 * @returns {*}
 */
export function addRoleList(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemRole/create",
    method: "post",
    data,
  });
}


/**
 * 更新角色
 * @param data
 * @returns {*}
 */
export function updateRoleList(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemRole/update",
    method: "post",
    data,
  });
}

/**
 * 删除角色
 * @param data
 * @returns {*}
 */
export function delRoleList(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemRole/delete",
    method: "post",
    data,
  });
}

/**
 * 搜索角色
 * @param data
 * @returns {*}
 */
export function searchTitle(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemRole/searchTitle",
    method: "post",
    data,
  });
}

/**
 * 查询所有用户
 * @param data
 * @returns {*}
 */
export function getAdminList(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemAdmin/index",
    method: "post",
    data,
  });
}

/**
 * 保存用户
 * @param data
 * @returns {*}
 */
export function addAdmin(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemAdmin/create",
    method: "post",
    data,
  });
}
/**
 * 删除用户
 * @param data
 * @returns {*}
 */
export function delAdmin(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemAdmin/delete",
    method: "post",
    data,
  });
}
/**
 * 更新用户
 * @param data
 * @returns {*}
 */
export function updateAdmin(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemAdmin/update",
    method: "post",
    data,
  });
}
/**
 * 搜索用户
 * @param data
 * @returns {*}
 */
export function searchAccount(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemAdmin/searchAccount",
    method: "post",
    data,
  });
}

/**
 * 创建菜单
 * @param data
 * @returns {*}
 */
export function addMenus(data) {
  return request({
    url: "/adminapi/v1.setting.SystemMenus/create",
    method: "post",
    data,
  });
}

/**
 * 创建菜单
 * @param data
 * @returns {*}
 */
export function updateMenus(data) {
  return request({
    url: "/adminapi/v1.setting.SystemMenus/update",
    method: "post",
    data,
  });
}

/**
 * 创建菜单
 * @param data
 * @returns {*}
 */
export function delMenus(data) {
  return request({
    url: "/adminapi/v1.setting.SystemMenus/delete",
    method: "post",
    data,
  });
}

/**
 * 搜索菜单
 * @param data
 * @returns {*}
 */
export function searchMenusTitle(data) {
  return request({
    url: "/adminapi/v1.setting.SystemMenus/searchTitle",
    method: "post",
    data,
  });
}

/**
 * 搜索菜单
 * @param data
 * @returns {*}
 */
export function menusDelete(data) {
  return request({
    url: "/adminapi/v1.setting.SystemMenus/delete",
    method: "post",
    data,
  });
}

/**
 * 查询子集权限
 * @param data
 * @returns {*}
 */
export function searchPidAndNotMenu(data) {
  return request({
    url: "/adminapi/v1.setting.SystemMenus/searchPidAndNotMenu",
    method: "post",
    data,
  });
}

/**
 * 查询所有菜单
 * @param data
 * @returns {*}
 */
export function getMenusList(data) {
  return request({
    url: "/adminapi/v1.setting.SystemMenus/getMenusList",
    method: "post",
    data,
  });
}


/**
 * 查询所有站点
 * @param data
 * @returns {*}
 */
export function getWebsiteList(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemWebsit",
    method: "post",
    data,
  });
}

/**
 * 创建站点
 * @param data
 * @returns {*}
 */
export function addWebsite(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemWebsit/create",
    method: "post",
    data,
  });
}
/**
 * 更新站点
 * @param data
 * @returns {*}
 */
export function updateWebsite(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemWebsit/update",
    method: "post",
    data,
  });
}
/**
 * 删除站点
 * @param data
 * @returns {*}
 */
export function deleteWebsite(data) {
  return request({
    url: "/adminapi/v1.setting.admin.SystemWebsit/delete",
    method: "post",
    data,
  });
}

/**
 * 首页数据
 * @param data
 * @returns {*}
 */
export function getIndexData(data) {
  return request({
    url: "/adminapi/Login/index",
    method: "post",
    data,
  });
}
